INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/cmsis_boot/
						${PROJECT_SOURCE_DIR}/src/cmsis_core/
						${PROJECT_SOURCE_DIR}/src/cmsis_lib/include/
						${PROJECT_SOURCE_DIR}/src/CoOS/kernel/
						${PROJECT_SOURCE_DIR}/src/CoOS/portable/
						${PROJECT_SOURCE_DIR}/src/device/include/)

SET(SRC_LIST main.c
			cmsis_boot/system_NUC123.c
			cmsis_boot/startup/startup_NUC123.c
			syscalls/syscalls.c
			debug/shell.c)
			
ADD_SUBDIRECTORY(uip)
ADD_SUBDIRECTORY(cmsis_lib)
ADD_SUBDIRECTORY(CoOS)
ADD_SUBDIRECTORY(device)

message("Frank DEBUG: PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR}")
message("Frank DEBUG: CMAKE_C_COMPILER ${CMAKE_C_COMPILER}")

ADD_EXECUTABLE(nuc123.elf ${SRC_LIST})

target_link_libraries(nuc123.elf -Wl,--start-group uip -Wl,--end-group)
target_link_libraries(nuc123.elf -Wl,--start-group device -Wl,--end-group)
target_link_libraries(nuc123.elf -Wl,--start-group CoOS -Wl,--end-group)
target_link_libraries(nuc123.elf -Wl,--start-group cmsis_lib -Wl,--end-group)

